Skip to content

Aliased pointers not recognized #24621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
antono2 opened this issue May 31, 2025 · 1 comment
Open

Aliased pointers not recognized #24621

antono2 opened this issue May 31, 2025 · 1 comment
Labels
Bug This tag is applied to issues which reports bugs.

Comments

@antono2
Copy link
Contributor

antono2 commented May 31, 2025

Describe the bug

I'd like to alias pointers

Reproduction Steps

type Col = string | int

struct MyType {
   cols []Col
}
pub type MyAlias = &MyType

pub struct MyStruct { pub mut: 
 array_of_mytype MyAlias = unsafe{nil} // [error](error: cannot assign `nil` to a non-pointer field)
 array_of_array_of_mytype &MyAlias = unsafe{nil}
}

fn main() {
   m := MyStruct{}
   println(m)
}

Expected Behavior

Set default nil for MyAlias, which is &MyType

Current Behavior

Currently you can use a voidptr and assign nil to that instead

Possible Solution

No response

Additional Information/Context

No response

V version

V 0.4.10 656afa9

Environment details (OS name and version, etc.)

V 0.4.10 656afa9

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

@antono2 antono2 added the Bug This tag is applied to issues which reports bugs. label May 31, 2025
Copy link

Connected to Huly®: V_0.6-22982

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This tag is applied to issues which reports bugs.
Projects
None yet
Development

No branches or pull requests

1 participant